﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using LotteryAdmin.AdminService;
using System.Threading;

namespace LotteryAdmin
{
    public partial class ChildPaijiang : ChildWindow
    {
        AdminService.LotteryAdminClient client = WcfProxy.GetProxy;
        public ChildPaijiang()
        {
            InitializeComponent();
            client.ManualPaijiangCompleted += new EventHandler<ManualPaijiangCompletedEventArgs>(client_ManualPaijiangCompleted);
        }

        void client_ManualPaijiangCompleted(object sender, ManualPaijiangCompletedEventArgs e)
        {
            this.loadingProgress.IsBusy = false;
            MessageBox.Show("操作成功!");
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            if (!Validate.ValidateNumsModify(this.txtbIssueNo.Text.Trim()))
            {
                MessageBox.Show("期号输入有误!");
                return;
            }
            this.loadingProgress.IsBusy = true;
            int index= this.cbxLotteryType.SelectedIndex + 1;
            client.ManualPaijiangAsync((AdminService.LotteryType)index, txtbIssueNo.Text.Trim());
        }
    }
}

